<!DOCTYPE html> 
<html lang="en"> 
<head> 
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQueryMobile - DateBox Demos</title>
	<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" />
	<link type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.min.css" rel="stylesheet" /> 
	<link type="text/css" href="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.css" rel="stylesheet" /> 
	<link type="text/css" href="http://dev.jtsage.com/jQM-DateBox/css/demos.css" rel="stylesheet" /> 
	
	<!-- NOTE: Script load order is significant! -->
	
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script> 
	<script type="text/javascript" src="http://code.jquery.com/mobile/latest/jquery.mobile.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/jquery.mousewheel.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.core.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.calbox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.datebox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.flipbox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.durationbox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.slidebox.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i18n/jquery.mobile.datebox.i18n.en_US.utf8.js"></script>
	
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/jQM-DateBox/demos/extras.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/gpretty/prettify.js"></script>
	<link type="text/css" href="http://dev.jtsage.com/gpretty/prettify.css" rel="stylesheet" />
	<script type="text/javascript">
		$('div').live('pagecreate', function() {
			prettyPrint()
		});
	</script>
	
</head>
<body>
<div data-role="page" id="timeIndex"> 
	<div data-role="header" data-position="fixed"> 
		<h1>jQueryMobile - DateBox</h1>
		<a href="../../" data-icon="home" data-iconpos="notext">Home</a>
	</div>
	<div data-role="content">
		<div class="content-secondary"> 
			<div id="jqm-homeheader"> 
				<h1 id="jqm-logo"><img src="../jquery-logo-db.png" alt="jQuery Mobile Framework :: DateBox" /></h1> 
				<p>A Date and Time Picker plugin for jQueryMobile</p> 
			</div> 
			
			<div class="scriptdemos sidebar"></div>
		</div>
		
		<div class="content-primary"> 
			<div data-role="collapsible-set" data-mini="true">
				<div data-role="collapsible" data-collapsed="false"> 
					<h2>Different Display and Submit Formats</h2>
				
					<div data-role="fieldcontain">
						<label for="split1">Date (D/M/Y)</label>
						<input name="split1" type="text" data-role="datebox" data-options='{"mode": "datebox", "overrideDateFormat":"%d/%m/%Y"}' id="split1" />
						<label for="split2">Second Format (Year-Month-Day)</label>
						<input name="split2" id="split2" type="text">
					</div>
					
					<script type="text/javascript">
						$('#split1').live('datebox', function(e,p) {
							if ( p.method === 'set') {
								$('#split2').val(
									$('#split1').datebox('callFormat','%Y-%m-%d', p.date)
								);
							}
						});
					</script>
					<p>You can also link inputs easily. (Show with optional 'center popup' option)</p>
					
					<strong>HTML</strong>
					<pre class="prettyprint">&lt;label for="split1"&gt;Date (D/M/Y)&lt;/label&gt;
&lt;input name="split1" type="text" data-role="datebox"
  data-options='{"mode": "datebox", "overrideDateFormat":"%d/%m/%Y"}' id="split1" /&gt;
&lt;label for="split2"&gt;Second Format (Year-Month-Day)&lt;/label&gt;
&lt;input name="split2" id="split2" type="text" /&gt;
					</pre>
					<strong>JQuery</strong>
					<pre class="prettyprint">$('#split1').live('datebox', function(e,p) {
  if ( p.method === 'set') {
    $('#split2').val(
      $('#split1').datebox('callFormat','%Y-%m-%d', p.date)
    );
  }  
});
					</pre>
				</div>
			</div>
		</div> 
		
	<div data-role="footer" data-position="fixed">
	</div>
</div>
</html>
